package com.amigo.online.consumer.user.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.amigo.online.common.base.controller.BaseConsumerController;
import com.amigo.online.common.core.response.Response;
import com.amigo.online.consumer.user.service.BlackService;

/**
 * 用户相关
 * @author amigo
 *
 */
@RestController
@RequestMapping(value = "/black", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class BlackController extends BaseConsumerController {
	
	@Autowired
	private BlackService blackService;
	
	
	@GetMapping(value = "/getBlackList/{page}/{size}")
	public ResponseEntity<Response> getBlackList(@PathVariable Integer page,@PathVariable Integer size){
		return blackService.getBlackList(page,size);
	}
	
	@RequestMapping(value = "/black/{userId}",method = RequestMethod.GET)
	public ResponseEntity<Response> blackUserById(@PathVariable Long userId){
		return blackService.blackUserById(userId);
	}
	
	@RequestMapping(value = "/isblack/{userId}",method = RequestMethod.GET)
	public ResponseEntity<Response>isBlack(@PathVariable Long userId){
		return blackService.isBlack(userId);
	}
	
	@RequestMapping(value = "/cancelBlack/{userId}",method = RequestMethod.GET)
	public ResponseEntity<Response> cancelBlackById(@PathVariable Long userId){
		return blackService.cancelBlackById(userId);
	}
	
}
